﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace demo
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write("返回与Web服务器上的指定虚拟路径相对应的物理文件路径 " + "[Server.MapPath(\"~\")]  " + Server.MapPath("~"));
            Response.Write("</br>");
            Response.Write("获取服务器上Asp.Net应用程序的虚拟应用程序根路径 " + "[Request.ApplicationPath]  " + Request.ApplicationPath);
            Response.Write("</br>");
            Response.Write("获取当前请求的虚拟路径 " + "[Request.CurrentExecutionFilePath]  " + Request.CurrentExecutionFilePath);
            Response.Write("</br>");
            Response.Write("获取当前请求的虚拟路径 " + "[Request.FilePath]  " + Request.FilePath);
            Response.Write("</br>");
            Response.Write("获取当前正在执行的服务器应用程序的根目录的物理文件系统路径 " + "[Request.PhysicalApplicationPath]  " + Request.PhysicalApplicationPath);
            Response.Write("</br>");
            Response.Write("获取与请求的URL相对应的物理文件系统路径 " + "[Request.PhysicalPath]  " + Request.PhysicalPath); 
        }
    }
}
